package com.os.opencv.java.chapter7;

import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.imgproc.Imgproc;

public class StructureElement {

    public static void main(String[] args) {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
        //构建一个5*5的小矩阵并导入数据
        Mat src = new Mat(5,5, CvType.CV_8UC1);

        //矩形结构元素
        Mat k0 = Imgproc.getStructuringElement(0, new Size(3,3));
        System.out.println(k0.dump());
        System.out.println();

        //十字形结构元素
        Mat k1 = Imgproc.getStructuringElement(1, new Size(3,3));
        System.out.println(k1.dump());
        System.out.println();

        //椭圆形结构元素
        Mat k2 = Imgproc.getStructuringElement(2, new Size(20,20));
        System.out.println(k2.dump());
        System.out.println();
    }
}
